<?php
namespace app\admin\model;
use think\Model;
use think\Db;
class Users extends Model {
	public $db;
	function __construct(){
		parent::__construct();
		$this->db=Db::name("users");
    }
    function count_m($username,$password){
    	$obj=M("users");

    	return $this->db->where("username='".$username."' and password='".$password."'")->count();
    }
    function add_m($arr){
    		return $this->db->add($arr);
    }
    //根据用户名判断是否存在
    function checkusername_m($username){
        return $this->db->where("username='".$username."'")->count();
    }
}